//
//  MainTopicViewController.m
//  ZITHER
//
//  Created by 吴凡 on 2019/2/14.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "MainTopicViewController.h"

@interface MainTopicViewController ()

@end

@implementation MainTopicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNav];
    
    [self setUI];
}

-(void)setNav{
    [self.baseNavigationView setHiddenNav:NO VC:self];
    
    /* TODO: ================= 导航栏V4样式 =================*/
    [self.baseNavigationView NavigationBarStyle:2];

    [self.baseNavigationView.NavViewStyleMyInterest.leftTitleBtn setTitle:@"话题" forState:UIControlStateNormal];
    [self.baseNavigationView.NavViewStyleMyInterest.rightTitleBtn setTitle:@"用户" forState:UIControlStateNormal];
    self.baseNavigationView.leftButton1.hidden = YES;
    self.baseNavigationView.isShowShadow = YES;
    
    
    /* TODO: ================= 导航栏关注 =================*/
    @weakify(self);
    [[self.baseNavigationView.NavViewStyleMyInterest.leftTitleBtn rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
        @strongify(self);
        [UIView animateWithDuration:0.3 animations:^{
            self.scroView.contentOffset = CGPointMake(0, 0);
        }];
    }];
    [[self.baseNavigationView.NavViewStyleMyInterest.rightTitleBtn rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
        @strongify(self);
        [UIView animateWithDuration:0.3 animations:^{
            self.scroView.contentOffset = CGPointMake(kScreenW, 0);
        }];
    }];
}

-(void)setUI{
    [self.view addSubview:self.scroView];
    [self.scroView changePage:0];
}

- (MainTopicScrollView *)scroView{
    if (!_scroView) {
        _scroView = [[MainTopicScrollView alloc]initWithFrame:CGRectMake(0, NaviHeight, kScreenW,kScreenH-NaviHeight)];
    }
    return  _scroView;
}

@end
